﻿class card{
	var id:Number;				//unique spell ID that corresponds to the name of the movie clip that represents its icon
	private var cardName:String;
	private var cardDescription:String;
	private var cardIcon:String;		//icon displayed as a 'card'
	var graphic:String;			//the graphic that corresponds to this card (Movieclip)
	var spellID:Number;
	var cooldown:Number;
	var magicType:String;		//dark, light, etc...
	private var type:String;			//unit, direct damage spell, aoe spell, building, etc... 

	function card(cName:String, cDescription:String, cIcon:String, sID:Number, c:Number, t:String, g:String){
		cardName = cName;
		cardDescription = cDescription;
		cardIcon = cIcon;
		spellID = sID;
		cooldown = c;
		type = t;
		graphic = g;
	}
	
	/**
	 * Takes the specified parameters and initializes this card
	 * @param cName the name of this card
	 * @param cDescription a description of this card
	 * @param cicon the name of the movie clip that represents this card
	 * @param sid this cards spell id
	 * @param c the cooldown this card requires
	 * @param t this cards type
	 * @param g the spell/unit/building graphic associated with this card	 */
	public function initCard(cName:String, cDescription:String, cIcon:String, sID:Number, c:Number, t:String, g:String){
		cardName = cName;
		cardDescription = cDescription;
		cardIcon = cIcon;
		spellID = sID;
		cooldown = c;
		type = t;
		graphic = g;
	}
	
	/**
	 * Creates a new card, copies this cards' data, and returns it
	 * @return a clone of this card	 */
	public function clone():card{
		//clones this card and returns a copy
		var ret:card = new card(cardName, cardDescription, cardIcon, spellID, cooldown, type, graphic);
		return ret;
	}
	
	/**
	 * Returns the name of this card
	 * @return the name of this card	 */
	public function getName():String{
		return cardName;
	}	
	
	/**
	 * Returns the description of this card
	 * @return the description of this card	 */
	public function getDescription():String{
		return cardDescription;	
	}
	
	/**
	 * Returns the name of the movieclip of the icon for this card
	 * @return the name of the movie clip of this icon for this card	 */
	public function getCardIcon():String{
		return cardIcon;	
	}
	
	/**
	 * Returns the type of this card
	 * @return returns the type of this card	 */
	public function getType():String{
		return type;
	}
	
}